home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / examples / mhf_server.c < prev    next >
C/C++ Source or Header  |  1997-07-22  |  17KB  |  581 lines

  1.  
  2. static char rcsid[] =
  3.     "$Id: mhf_server.c,v 1.2 1997/07/09 13:25:12 pvmsrc Exp $";
  4.  
  5. /*
  6.  *         PVM version 3.4:  Parallel Virtual Machine System
  7.  *               University of Tennessee, Knoxville TN.
  8.  *           Oak Ridge National Laboratory, Oak Ridge TN.
  9.  *                   Emory University, Atlanta GA.
  10.  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
  11.  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
  12.  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
  13.  *                   (C) 1997 All Rights Reserved
  14.  *
  15.  *                              NOTICE
  16.  *
  17.  * Permission to use, copy, modify, and distribute this software and
  18.  * its documentation for any purpose and without fee is hereby granted
  19.  * provided that the above copyright notice appear in all copies and
  20.  * that both the copyright notice and this permission notice appear in
  21.  * supporting documentation.
  22.  *
  23.  * Neither the Institutions (Emory University, Oak Ridge National
  24.  * Laboratory, and University of Tennessee) nor the Authors make any
  25.  * representations about the suitability of this software for any
  26.  * purpose.  This software is provided ``as is'' without express or
  27.  * implied warranty.
  28.  *
  29.  * PVM version 3 was funded in part by the U.S. Department of Energy,
  30.  * the National Science Foundation and the State of Tennessee.
  31.  */
  32.  
  33. /***************************************************************
  34. *    Filename: mhf_server.c
  35. *
  36. *  This is a "server" program for testing message handler functions.
  37. *  Use the mhf_tickle program to speak to this server.
  38. *
  39. *  Operation:
  40. *    1. startup pvm console
  41. *    2. startup the mhf_server
  42. *    3. startup as many mhf_tickle instances as you wish
  43. *        - follow menu options and in-code comments on
  44. *          how to run and what it tests / shows...
  45. *
  46. ***************************************************************/
  47.  
  48. #include "stdio.h"
  49. #include "pvm3.h"
  50.  
  51. #define NOISE1 1     /* sets level of program noise  - minimum noise */
  52. /* #define NOISE2 2     each level "up" adds noise  */
  53.  
  54. #define  PMH 0        /* display present message handlers        */
  55. #define  LMH 1        /* load message handler                */
  56. #define  DMH 2        /* delete message handler            */
  57. #define  ERJ 3        /* tell mhf_server() to pvm_exit() and rejoin */
  58. #define  HIT 4        /* message to hit a specified handler...    */
  59. #define GSMB 7        /* NOT USED IN mhf_server() - use to grab the */
  60.                     /* mhf_server contact info from mailbox again... */
  61. #define CEAT 8        /* client (this program ) exit pvm and terminate */
  62.                     /* self  - server not contacted... */
  63. #define SEAT 9        /* server exits pvm and terminate self        */
  64.  
  65. #define SC1 1        /* string_catcher1 */
  66. #define SC2 2        /* string_catcher2 */
  67. #define SC3 3        /* string_catcher3 */
  68. #define SC4 4        /* string_catcher4 */
  69. #define SC5 5        /* string_catcher5 */
  70. #define IC1 6        /* int_catcher6 */
  71. #define IC2 7        /* int_catcher7 */
  72. #define IC3 8        /* int_catcher8 */
  73. #define IC4 9        /* int_catcher9 */
  74. #define IC5 0        /* int_catcher10 */
  75.  
  76. #define STR_LEN 100
  77. #define YES 1
  78. #define NO 0
  79.  
  80. /*
  81. *  private - function prototypes
  82. */
  83. int register_server( int, int, char *, char * );
  84.  
  85. /*
  86. *  private - function prototypes for message handlers
  87. */
  88. int string_catcher1( int );    /* prototype */
  89. int string_catcher2( int );    /* prototype */
  90. int string_catcher3( int );    /* prototype */
  91. int string_catcher4( int );    /* prototype */
  92. int string_catcher5( int );    /* prototype */
  93. int int_catcher6( int );    /* prototype */
  94. int int_catcher7( int );    /* prototype */
  95. int int_catcher8( int );    /* prototype */
  96. int int_catcher9( int );    /* prototype */
  97. int int_catcher10( int );    /* prototype */
  98.  
  99.  
  100. /*
  101. *  globals to bring back message handler information
  102. */
  103. int mhf_catch;        /* should be same as number of "catcher" hit */
  104. int mhf_magic_number;
  105. char mhf_msg[STR_LEN];
  106.  
  107.  
  108. /**********************************************************************/
  109. main ( argc, argv ) 
  110. int argc;
  111. char *argv[];
  112. {    char *me = "mhf_server";
  113.     int cc;            /* local stuff */
  114.     int mytid;        /* tid of this server */
  115.     int ctid;        /* tid of request sender - to this server */
  116.     int msgtag;        /* sender specified message tag */
  117.     int length;        /* length of message */
  118.     int sctx;        /* server's context */
  119.     int info;        /* status return and temporary input values */
  120.     int mhid;        /* message handler id */
  121.     int lmh;        /* int represent local message handler to ping */
  122.     int index;        /* mailbox entry index */
  123.     char msg[STR_LEN];    /* used for local info messages */
  124.     char msg_txt[STR_LEN];    /* used for received messages */
  125.     char machine[25];
  126.     int FOREVER = YES;
  127.  
  128.     /*
  129.     *  for display - note IC5 position
  130.     */
  131.     char *mh_arr[] = { "IC5", "SC1", "SC2", "SC3", "SC4", "SC5", "IC1",
  132.             "IC2", "IC3", "IC4" };
  133.  
  134.     /* expected message information coming from "tickle" program */
  135.     char action_tag;    /* action for server to take -> p, l, d, x j */
  136.     int src;        /* message source = sender's tid */
  137.     int tag;        /* message tag */
  138.     int ctx;        /* message context */
  139.  
  140.     if ( ( mytid = pvm_mytid( ) ) < 0 ){
  141.         printf( "\n%s: try starting pvm first...\n", me );
  142.         exit( -1 );
  143.     }
  144.  
  145.     gethostname( machine, 25 );
  146.     sctx = pvm_newcontext( );        /* get new context */
  147.     pvm_setcontext( sctx );            /* activate new context */
  148.     printf( "%s: t%x on machine <%s> with context %d.\n",
  149.             me, mytid, machine, pvm_getcontext( ) );
  150.     if ( register_server( mytid, sctx, machine, me ) < 0 ){
  151.         pvm_exit( );
  152.         exit( -1 );
  153.     }
  154.  
  155.     pvmdisplaymhfinfo( me, "startup...", mytid );
  156.  
  157.     /*
  158.     *  startup message "server" to wait for messages
  159.     *  leave when receive the "END" message
  160.     *
  161.     *  Remember: message handlers are keying on specific
  162.     *    source - tag - context --> tuples...
  163.     */
  164.     while( FOREVER )
  165.     {
  166.         if ( ( cc = pvm_recv( -1, -1 ) ) < 0 ){        /* receive all */
  167.             lpvmerr( "\nmhf_server: pvm_recv( ): error %d", cc );
  168.             pvm_exit( ); exit( 0 );
  169.         }
  170.         /* who sent message */
  171.         if ( (info = pvm_bufinfo( cc, &length, &msgtag, &ctid )) < 0 ){
  172.             lpvmerr( "\nmhf_server: pvm_bufinfo( ): error %d", info );
  173.             pvm_exit( ); exit( 0 );
  174.         }
  175.  
  176.         switch ( msgtag ){
  177.         case PMH:  /* display present message handlers */
  178.                 pvm_upkstr( msg_txt );
  179.                 sprintf( msg, "%s: PMH: %s", me, msg_txt );
  180.                 pvmdisplaymhfinfo( me, msg, mytid );
  181.                 break;
  182.  
  183.         /* load message handler */
  184.         /* ( src=tid_of_sender ...usually..., tag, ctx ) */
  185.         case LMH:
  186.                 /* tid of msg handler ONLY user - unless wildcard -1 */
  187.                 pvm_upkint( &src, 1, 1 );
  188.                 pvm_upkint( &tag, 1, 1 );
  189.                 pvm_upkint( &ctx, 1, 1 );
  190.                 /* number indicates which handler to load */
  191.                 pvm_upkint( &info, 1, 1 );
  192. #ifdef NOISE2
  193.                 sprintf( msg,
  194.                     "%s: LMH: BEFORE load with pvm_addmhf( src = t%x, tag = %d, ctx = %d )  -> load %s",
  195.                     me, src, tag, ctx, mh_arr[info] );
  196.                 pvmdisplaymhfinfo( me, msg, mytid );
  197. #endif
  198.                 switch ( info ){
  199.                 case SC1:
  200.                     mhid = pvm_addmhf( src, tag, ctx, string_catcher1 );
  201.                     break;
  202.                 case SC2:
  203.                     mhid = pvm_addmhf( src, tag, ctx, string_catcher2 );
  204.                     break;
  205.                 case SC3:
  206.                     mhid = pvm_addmhf( src, tag, ctx, string_catcher3 );
  207.                     break;
  208.                 case SC4:
  209.                     mhid = pvm_addmhf( src, tag, ctx, string_catcher4 );
  210.                     break;
  211.                 case SC5:
  212.                     mhid = pvm_addmhf( src, tag, ctx, string_catcher5 );
  213.                     break;
  214.                 case IC1:
  215.                     mhid = pvm_addmhf( src, tag, ctx, int_catcher6 );
  216.                     break;
  217.                 case IC2:
  218.                     mhid = pvm_addmhf( src, tag, ctx, int_catcher7 );
  219.                     break;
  220.                 case IC3:
  221.                     mhid = pvm_addmhf( src, tag, ctx, int_catcher8 );
  222.                     break;
  223.                 case IC4:
  224.                     mhid = pvm_addmhf( src, tag, ctx, int_catcher9 );
  225.                     break;
  226.                 case IC5:
  227.                     mhid = pvm_addmhf( src, tag, ctx, int_catcher10 );
  228.                     break;
  229.                 default:
  230.                     printf( "\n%s: no such message handler <%d> to load...  Only 0 - 9 available!", me, info );
  231.                     mhid = PvmBadParam;
  232.                     break;
  233.                 } /* end_switch ( info ) */
  234.  
  235.                 if ( mhid == PvmExists ){
  236.                     printf( "\n%s: message handler already exists...\n", me );
  237.                     break;
  238.                 }
  239.                 if ( mhid < 0 ){
  240.                     printf( "\n%s: pvm_addmhf failed with error code %d.\n", me, mhid );
  241.                     break;
  242.                 }
  243. #ifdef NOISE1
  244.                 sprintf( msg, 
  245.                     "%s: LMH: AFTER load with pvm_addmhf( src = t%x, tag = %d, ctx = %d )  -> loaded %s", 
  246.                     me, src, tag, ctx, mh_arr[info] );
  247.                 pvmdisplaymhfinfo( me, msg, mytid );
  248. #endif
  249.                 break;
  250.  
  251.         case DMH:  /* delete message handler */
  252.                 pvm_upkint( &mhid, 1, 1 );
  253. #ifdef NOISE2
  254.                 sprintf( msg, "%s: DMH: BEFORE delete with pvm_delmhf( mhid = %d )", me, mhid );
  255.                 pvmdisplaymhfinfo( me, msg, mytid );
  256. #endif
  257.                 if ( ( info = pvm_delmhf( mhid ) ) < 0 ){
  258.                     sprintf( msg,"%s: pvm_delmhf failed - no such handler existed.", me );
  259.                     lpvmerr( msg, PvmNotFound );
  260.                     break;
  261.                 }
  262.                 sprintf( msg, "%s: DMH: AFTER delete with pvm_delmhf( mhid = %d )", me, mhid );
  263.                 pvmdisplaymhfinfo( me, msg, mytid );
  264.                 break;
  265.  
  266.         case ERJ:  /* tell mhf_server() to pvm_exit( ) and then rejoin ->> check message handlers existance */
  267. #ifdef NOISE2
  268.                 sprintf( msg, "%s: ERJ: BEFORE pvm_exit( )", me );
  269.                 pvmdisplaymhfinfo( me, msg, mytid );
  270. #endif
  271.                 /*
  272.                 *  exit pvm part...
  273.                 */
  274.                 if ( ( info = pvm_exit( ) ) < 0 ){
  275.                     printf( "\n%s: pvm_exit failed with error code %d.\n", me, info );
  276.                     break;
  277.                 }
  278. #ifdef NOISE1
  279.                 printf( "\n%s: Just did pvm_exit...\n", me );
  280.                 sprintf( msg, "%s: ERJ: AFTER pvm_exit( )", me );
  281.                 pvmdisplaymhfinfo( me, msg, mytid );
  282. #endif
  283.                 /*
  284.                 *  rejoin pvm part...
  285.                 */
  286.                 if ( ( mytid = pvm_mytid( ) ) < 0 ){
  287.                     printf( "\n%s: could not restart - pvm not up...\n", me );
  288.                     exit( -1 );
  289.                 }
  290.  
  291. #ifdef NOISE1
  292.                 printf( "%s: just rejoined pvm...\n", me );
  293.                 printf( "%s: restarted as t%x on machine <%s> with context %d.\n", me, mytid, machine, pvm_getcontext( ) );
  294.                 sprintf( msg, "%s: ERJ: rejoin pvm AFTER pvm_exit( )", me );
  295.                 pvmdisplaymhfinfo( me, msg, mytid );
  296. #endif
  297.                 /*
  298.                 *  re-register server via mailbox...
  299.                 */
  300.                 if ( ( info = register_server( mytid, sctx, machine, me ) ) < 0 ){
  301.                     printf( "\n%s: register_server( ) failed with error code %d.\n", me, info );
  302.                     pvm_exit( );
  303.                     exit( -1 );
  304.                 }
  305. #ifdef NOISE1
  306.                 printf( "%s: just registered server...\n", me );
  307. #endif
  308.                 break;
  309.  
  310.         case HIT:  /* message to hit a specified handler... */
  311.  
  312.                 pvm_upkint( &lmh, 1, 1 );    /* integer indicates which target trying to ping */
  313.  
  314.                 if ( lmh == mhf_catch )
  315.                     printf( "\n%s: HIT:  ping target %d - %s   ", me, lmh, mh_arr[lmh] );
  316.                 else
  317.                     printf( "\n%s: NO HIT:  lmh = %d - %s   mhf_catch = %d - ?C?   ", 
  318.                         me, lmh, mh_arr[lmh], mhf_catch );
  319.  
  320.                 switch ( lmh ) {
  321.                 case 1: case 2: case 3: case 4: case 5:
  322.                     pvm_upkstr( msg_txt );
  323.                     if ( strcmp( msg_txt, mhf_msg ) == 0 )
  324.                         printf( "strings match <%s>.\n", msg_txt );
  325.                     else
  326.                         printf( "strings NO match - local <%s>   mhf <%s>.\n", msg_txt, mhf_msg );
  327.                     break;
  328.                 case 0: case 6: case 7: case 8: case 9:
  329.                     pvm_upkint( &cc, 1, 1 );
  330.                     if ( cc == mhf_magic_number )
  331.                         printf( "magic_numbers match %d.\n", cc );
  332.                     else
  333.                         printf( "magic_numbers NO match - local %d   mhf %d.\n", cc, mhf_magic_number );
  334.                     break;
  335.                 }
  336.  
  337.                 sprintf( msg, "%s: HIT:" );
  338.                 pvmdisplaymhfinfo( me, msg, mytid );
  339.  
  340.                 /*
  341.                 *  reset globals to some known values for testing
  342.                 */
  343.                 mhf_catch = -99;
  344.                 mhf_magic_number = -99;
  345.                 strcpy ( mhf_msg, "NO MATCH" );
  346.                 break;
  347.  
  348.         case SEAT:  /* server exits pvm and terminate self */
  349.                 sprintf( msg, "%s: CEAT: Termiate Self...", me );
  350.                 pvmdisplaymhfinfo( me, msg, mytid );
  351.                 FOREVER = NO;                /* will cause program termination */
  352.                 break;
  353.  
  354.         default:/* invalid msgtag - just ignore the message
  355.             */
  356.             printf( "%s: default: INVALID msgtag:   length = %d     msgtag = <%d>     ctid = t%x", 
  357.                 me, length, msgtag, ctid );
  358.             break;
  359.         } /* switch_end */
  360.         fflush( stdout );
  361.     } /* end_while_FOREVER */
  362.     pvm_exit( );
  363.     exit( 0 );
  364. } /* end_main */
  365.  
  366.  
  367.  
  368. /**********************************************************************
  369. *  register this server via "well known" mailbox so others may contact us
  370. *  mailbox name is set to...  server = "mhf_server"
  371. *
  372. *  Returns mailbox index where placed
  373. */
  374. int
  375. register_server( mytid, ctx, machine, server )
  376. int mytid;
  377. int ctx;
  378. char *machine;
  379. char *server;
  380. {    char *me = "register_server";
  381.     int index;
  382.  
  383.     pvm_initsend( PvmDataDefault );
  384.     pvm_pkint( &mytid, 1, 1 );
  385.     pvm_pkint( &ctx, 1, 1 );
  386.     pvm_pkstr( machine );
  387.     if ( ( index = pvm_putinfo( server, pvm_getsbuf( ), PvmMboxDefault ) ) < 0 ) {
  388.         /*
  389.          *  problem inserting mailbox entry - tell user why, exit pvm, and terminate task...
  390.          */
  391.         switch ( index ) {
  392.             case PvmExists:
  393.                 printf( "\n%s: Named service already running\n", me );
  394.                 break;
  395.             case PvmBadParam:
  396.                 printf( "\n%s: Invalid argument to pvm_recvinfo( ).\n", me );
  397.                 break;
  398.             case PvmNoSuchBuf:
  399.                 printf( "\n%s: Message buffer id does not exist.\n", me );
  400.                 break;
  401.             case PvmDenied:
  402.                 printf( "\n%s: Key locked by another task, can't delete.\n", me );
  403.                 break;
  404.             case PvmNoMem:
  405.                 printf( "\n%s: Libpvm is unable to allocate memory to pack data.\n", me );
  406.                 break;
  407.             case PvmNotFound:
  408.                 printf( "\n%s: Requested key does not exist.\n", me );
  409.                 break;
  410.             default:
  411.                 lpvmerr( "\n%s: task0.c: error %d", me, index );
  412.                 break;
  413.         } /* end_switch */
  414.         return( index );        /* returns error code */
  415.     }
  416.     printf( "%s: mailbox... just inserted server <%s> at mailbox %d with context %d.\n", 
  417.         me, server, index, ctx );
  418.     return( index );
  419. } /* register_server */
  420.  
  421.  
  422. /**********************************************************************
  423. *  Function:    string_catcher1        - unpack 1 string
  424. *        string_catcher2        - unpack 2 strings
  425. *        string_catcher3        - unpack 3 strings
  426. *        string_catcher4        - unpack 4 strings
  427. *        string_catcher5        - unpack 5 strings
  428. *
  429. *        int_catcher6        - unpack 1 integer
  430. *        int_catcher7        - unpack 2 integers
  431. *        int_catcher8        - unpack 3 integers
  432. *        int_catcher9        - unpack 4 integers
  433. *        int_catcher10        - unpack 5 integers
  434. *
  435. *  These are all simple message handlers to use in testing loading,
  436. *  deleting, and using message handlers.
  437. *
  438. *  Each one simply echos out the information that is being sent.
  439. *  Thus showing that a given handler may "handle" messages of a given type.
  440. **********************************************************************/
  441. int
  442. string_catcher1( mid )
  443. int mid;
  444. {    char *me = "string_catcher1";
  445.     int rbf;
  446.     rbf = pvm_setrbuf( mid );
  447.  
  448.     pvm_upkint( &mhf_catch, 1, 1 );
  449.     pvm_upkstr( mhf_msg );
  450.     printf( "\n%s: string_catcher%d received message -->> <%s>\n\n", me, mhf_catch, mhf_msg );
  451.  
  452.     pvm_freebuf( pvm_setrbuf( rbf ) );
  453. } /* string_catcher1 */
  454.  
  455. int
  456. string_catcher2( mid )
  457. int mid;
  458. {    char *me = "string_catcher2";
  459.     int rbf;
  460.     rbf = pvm_setrbuf( mid );
  461.  
  462.     pvm_upkint( &mhf_catch, 1, 1 );
  463.     pvm_upkstr( mhf_msg );
  464.     printf( "\n%s: string_catcher%d received message -->> <%s>\n\n", me, mhf_catch, mhf_msg );
  465.  
  466.     pvm_freebuf( pvm_setrbuf( rbf ) );
  467. } /* string_catcher2 */
  468.  
  469. int
  470. string_catcher3( mid )
  471. int mid;
  472. {    char *me = "string_catcher3";
  473.     int rbf;
  474.     rbf = pvm_setrbuf( mid );
  475.  
  476.     pvm_upkint( &mhf_catch, 1, 1 );
  477.     pvm_upkstr( mhf_msg );
  478.     printf( "\n%s: string_catcher%d received message -->> <%s>\n\n", me, mhf_catch, mhf_msg );
  479.  
  480.     pvm_freebuf( pvm_setrbuf( rbf ) );
  481. } /* string_catcher3 */
  482.  
  483. int
  484. string_catcher4( mid )
  485. int mid;
  486. {    char *me = "string_catcher4";
  487.     int rbf;
  488.     rbf = pvm_setrbuf( mid );
  489.  
  490.     pvm_upkint( &mhf_catch, 1, 1 );
  491.     pvm_upkstr( mhf_msg );
  492.     printf( "\n%s: string_catcher%d received message -->> <%s>\n\n", me, mhf_catch, mhf_msg );
  493.  
  494.     pvm_freebuf( pvm_setrbuf( rbf ) );
  495. } /* string_catcher4 */
  496.  
  497. int
  498. string_catcher5( mid )
  499. int mid;
  500. {    char *me = "string_catcher5";
  501.     int rbf;
  502.     rbf = pvm_setrbuf( mid );
  503.  
  504.     pvm_upkint( &mhf_catch, 1, 1 );
  505.     pvm_upkstr( mhf_msg );
  506.     printf( "\n%s: string_catcher%d received message -->> <%s>\n\n", me, mhf_catch, mhf_msg );
  507.  
  508.     pvm_freebuf( pvm_setrbuf( rbf ) );
  509. } /* string_catcher5 */
  510.  
  511. int
  512. int_catcher6( mid )
  513. int mid;
  514. {    char *me = "int_catcher6";
  515.     int rbf;
  516.     rbf = pvm_setrbuf( mid );
  517.  
  518.     pvm_upkint( &mhf_catch, 1, 1 );
  519.     pvm_upkint( &mhf_magic_number, 1, 1 );
  520.     printf( "\n%s: int_catcher%d received magic number -->> %d.\n\n", me, mhf_catch, mhf_magic_number );
  521.  
  522.     pvm_freebuf( pvm_setrbuf( rbf ) );
  523. } /* int_catcher6 */
  524.  
  525. int
  526. int_catcher7( mid )
  527. int mid;
  528. {    char *me = "int_catcher7";
  529.     int rbf;
  530.     rbf = pvm_setrbuf( mid );
  531.  
  532.     pvm_upkint( &mhf_catch, 1, 1 );
  533.     pvm_upkint( &mhf_magic_number, 1, 1 );
  534.     printf( "\n%s: int_catcher%d received magic number -->> %d.\n\n", me, mhf_catch, mhf_magic_number );
  535.  
  536.     pvm_freebuf( pvm_setrbuf( rbf ) );
  537. } /* int_catcher7 */
  538.  
  539. int
  540. int_catcher8( mid )
  541. int mid;
  542. {    char *me = "int_catcher8";
  543.     int rbf;
  544.     rbf = pvm_setrbuf( mid );
  545.  
  546.     pvm_upkint( &mhf_catch, 1, 1 );
  547.     pvm_upkint( &mhf_magic_number, 1, 1 );
  548.     printf( "\n%s: int_catcher%d received magic number -->> %d.\n\n", me, mhf_catch, mhf_magic_number );
  549.  
  550.     pvm_freebuf( pvm_setrbuf( rbf ) );
  551. } /* int_catcher8 */
  552.  
  553. int
  554. int_catcher9( mid )
  555. int mid;
  556. {    char *me = "int_catcher9";
  557.     int rbf;
  558.     rbf = pvm_setrbuf( mid );
  559.  
  560.     pvm_upkint( &mhf_catch, 1, 1 );
  561.     pvm_upkint( &mhf_magic_number, 1, 1 );
  562.     printf( "\n%s: int_catcher%d received magic number -->> %d.\n\n", me, mhf_catch, mhf_magic_number );
  563.  
  564.     pvm_freebuf( pvm_setrbuf( rbf ) );
  565. } /* int_catcher9 */
  566.  
  567. int
  568. int_catcher10( mid )
  569. int mid;
  570. {    char *me = "int_catcher10";
  571.     int rbf;
  572.     rbf = pvm_setrbuf( mid );
  573.  
  574.     pvm_upkint( &mhf_catch, 1, 1 );
  575.     pvm_upkint( &mhf_magic_number, 1, 1 );
  576.     printf( "\n%s: int_catcher%d received magic number -->> %d.\n\n", me, mhf_catch, mhf_magic_number );
  577.  
  578.     pvm_freebuf( pvm_setrbuf( rbf ) );
  579. } /* int_catcher10 */
  580.  
  581.